<?php

namespace Console\Controller;

use Common\Controller\AdminAuthController;

class CstBaseController extends AdminAuthController
{
    private $roleLogic;

    public function _initialize()
    {
        parent::_initialize();

        if (!IS_AJAX) {
            $this->roleLogic = A("Console/Role", 'Logic');
            $userInfo = $this->getUserInfo();
            $role = $userInfo['role'];
            if (!$this->roleLogic->verityAuth($role, CONTROLLER_NAME, ACTION_NAME)) {
                $this->sysErr("您无访问权限");
            }
        }

    }
}
